package com.skyolder.milkbee.repository;

import com.skyolder.milkbee.domain.Category;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.*;

import java.util.List;

/**
 * Spring Data JPA repository for the Category entity.
 */
@SuppressWarnings("unused")
public interface CategoryRepository extends JpaRepository<Category,Long> {

	List<Category> findByParentId(Long parentId);

	List<Category> findByLevel(Long level);
	
	@Query("from Category c where c.id in(?1)")
	Page<Category> doQueryByIds(List<Long> categoryIds, Pageable pageable);

}
